<!-- 详情 -->
<template>
	<view class="p-3">
		<view class="bt-block">
			<bg-cell2 label="项目名称" :value="obj.projectName"></bg-cell2>
			<bg-cell2 label="选择人员" :value="`${obj.userName}(${getLastFour(obj.idCardNo)})`"></bg-cell2>
			<!-- <bg-cell2 label="三级教育" :border="false">
				<template slot="extra">
					<bg-images :imgList="obj.imgsList"></bg-images>
				</template>
			</bg-cell2> -->
			<bg-cell2 label="班组管理员-班组级安全教育" :border="false">
				<template slot="extra">
					<bg-images :imgList="obj.teamImgsList"></bg-images>
				</template>
			</bg-cell2>
			<bg-cell2 label="项目管理员-项目级安全教育" :border="false">
				<template slot="extra">
					<bg-images :imgList="obj.projectImgsList"></bg-images>
				</template>
			</bg-cell2>
			<bg-cell2 label="安全管理员-公司级安全教育" :border="false">
				<template slot="extra">
					<bg-images :imgList="obj.safetyImgsList"></bg-images>
				</template>
			</bg-cell2>
		</view>
	</view>
</template>

<script>
	import {threeDetail} from "@/api/system/study.js"
	export default {
		onNavigationBarButtonTap() {
			uni.navigateTo({
				url:"/pages/enter/education/upload?id="+this.id
			})
		},
		onLoad(options){
			this.id = options.id
			this.getData()
			uni.$on("refresh-three", ()=>{
				this.getData()
			})
		},
		data() {
			return {
				id:'',
				obj:{}
			}
		},
		methods: {
			getData(){
				threeDetail(this.id).then(res=>{
					this.obj = res.data
				})
			},
			getLastFour(str){
				if(str){
					return str.substring(str.length - 4);
				} else {
					return ''
				}
			}
		}
	}
</script>

<style>

</style>
